﻿using System;

namespace TomNet.Attributes
{
    /// <summary>
    /// 验证基类
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = true)]
    public abstract class BaseAttribute : Attribute
    {
        /// <summary>
        /// 错误信息
        /// </summary>
        public virtual string Error { get; set; }

        /// <summary>
        /// 验证方法
        /// </summary>
        /// <param name="value">数据对象</param>
        /// <returns>返回结果true或者false</returns>
        public abstract bool Validate(object value);
    }
}
